package com.station.administrators.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.station.administrators.dao.BusinessDao;
import com.open.capacity.common.model.BusinessModel;
import com.station.administrators.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author YangGang
 * @Title:
 * @Description: TODO
 * @date 2021/6/28/14:34
 */
@Service
public class BusinessServiceImpl implements BusinessService {
    @Autowired
    private BusinessDao businessDao;

    @Override
    public PageInfo<BusinessModel> findAll(BusinessModel businessModel) {
        Integer page = businessModel.getPage();
        Integer limit = businessModel.getLimit();
        PageHelper.startPage(page,limit);
        PageInfo<BusinessModel> businessModelPageInfo = new PageInfo<>(businessDao.findAll(businessModel));
        return businessModelPageInfo;
    }

    @Override
    public void examine(Long id) {
        businessDao.examine(id);
    }

    @Override
    public void enable(BusinessModel businessModel) {
        businessDao.enable(businessModel);
    }
}
